There are numerous circumstances in which it is desirable to detect, measure or monitor a constituent of a fluid. One of the commonest requirements is to determine hydrogen ion concentration (generally expressed on the logarithmic pH scale) of aqueous fluids which may for example be a water supply or an effluent. The determination of the pH of a solution is one of the most common analytical measurements and can be regarded as the most critical parameter in water chemistry. Nearly all water samples will have their pH tested at some point in their life cycle as many chemical processes are dependent on pH. Another common requirement is to determine oxygen content in water.
A particularly challenging context is the analysis of downhole fluids, that is to say fluids encountered at underground locations accessed by a wellbore. In the context of hydrocarbon production, analysis of downhole fluids can be an important aspect of determining the quality and economic value of a hydrocarbon formation. Knowledge of downhole formation (produced) water chemistry can be applied to save costs and increase production at all stages of oil and gas exploration and production. Measurements obtained downhole can be important for a number of key processes of hydrocarbon production, including:                Prediction and assessment of mineral scale and corrosion;        Strategy for oil/water separation and water re-injection;        Understanding of reservoir compartmentalization/flow units;        Characterization of water break-through;        Derivation of the water cut Rw; and        Evaluation of downhole H2S partition in the oil and or water (if used for H2S measurements).        
Some chemical species dissolved in water (for example, Cl− and Na+) do not change their concentration when moved to the surface either as a part of a flow through a well, or as a sample taken downhole. Consequently information about their quantities may be obtained from downhole samples and in some cases surface samples of a flow. However, the state of chemical species, such as H+ (noting that pH=−log [concentration of H+]), CO2, or H2S may change significantly while tripping to the surface. The change occurs mainly due to a difference in temperature and pressure between downhole and surface environment. In case of samples taken downhole, this change may also happen due to degassing of a sample (seal failure), mineral precipitation in a sampling bottle, and (especially in case of H2S)—a chemical reaction with the sampling chamber. It should be stressed that, in the field of hydrocarbon production, pH, H2S, and CO2 are among the most critical parameters for corrosion and scale assessment. Consequently it is of considerable importance to determine their downhole values and there have been a number of proposals for analytical sensors to be used downhole. However, the downhole environment is apt to be chemically aggressive and the lifetime and stability of sensors is an issue. Whilst hydrocarbon production is an area of application of considerable significance, parallel issues arise when investigating downhole fluids in other circumstances.
One approach to the construction of sensors to be used below the Earth's surface makes use of an electrochemical reaction brought about by the application of potential to electrodes, where the electrochemical response is altered by the presence of an analyte species and in consequence the alteration in the electrochemical response serves as a measure of the concentration of the analyte species.
An electrochemical sensor may then comprise electrodes and one or more electrochemically active species able to undergo electrochemical reaction in response to electrical potential applied to the electrodes, where that electrochemical reaction is modified by the presence of an analyte species.
One example of an electrochemical pH sensor is disclosed in U.S. Pat. No. 5,223,117, where the sensor was intended for use in a number of applications including biomedical sensing. Two electrochemically active species were attached to a gold substrate which provided an electrode. Both of these attached species were redox systems. One of the attached species was hydroquinone whose redox potential is sensitive to the concentration of hydrogen ions while the other attached species was ferrocene which serves as a reference because its redox potential is insensitive to hydrogen ion concentration. This sensor was used in voltammetry in which the gold substrate with the attached redox systems and the counter electrode are placed in contact with a solution to be tested. The potential applied to the gold substrate was systematically varied and current flow was monitored. With such a system, a plot of current against applied voltage, a so-called voltammogram, shows current peaks when the applied voltage is such that the redox reactions take place. The voltage difference between the voltage giving peak current for the ferrocene reference and the voltage giving peak current for hydroquinone provides a measure of the pH of the solution under test.
Examples of sensors intended to be suitable for use downhole, incorporating electrodes and electrochemically active species, are described in WO 2005/066618 and WO 2007/034131. These documents envisage immobilizing redox systems on a conductive carbon substrate. In the latter document, two redox systems were incorporated chemically into a copolymer made from vinyl ferrocene and vinyl anthracene so that the two redox systems were present as side chains from the hydrocarbon backbone of the polymer. This fixed their proportions relative to each other. However, problems have been found to arise when redox systems are attached to macromolecules. The vast majority of polymers have transition temperatures above which the physical properties of the polymer alter. There is a loss of physical stability, which can be profoundly detrimental to the ability of a polymer to act as a sensor. Secondly, when redox systems are distributed along a polymer chain, it is possible for an electron to hop from one redox centre to the next along the chain, interfering with reversibility of the redox reaction. This phenomenon has been demonstrated in particular for polyvinyl ferrocene and its derivatives, where it was found that the cyclic voltammetric response can be sensitive not only to the analyte of interest but also to the concentration of other anions in solution, with decays in signal observed in the presence of certain anions (see K. L. Robinson and N. S. Lawrence, Electrochem. Commun., vol 8 page 1005 (2006).